package com.wan.adapter

import android.content.Context
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import com.wan.R
import com.wan.entity.CommonlyEntity
import com.wan.uitls.FlowItemClickListener
import com.wan.uitls.ItemClickListener
import com.zhy.view.flowlayout.FlowLayout
import com.zhy.view.flowlayout.TagAdapter

/**
 * 常用页面适配器
 */
class CommonlyAdapter(var context: Context, var dataList: ArrayList<CommonlyEntity>) : TagAdapter<CommonlyEntity>(dataList) {

    private val mThreadName = this.javaClass.name

    override fun getView(parent: FlowLayout?, position: Int, t: CommonlyEntity?): View {
        val rootView = LayoutInflater.from(context).inflate(R.layout.navigation_flow_item_layout, parent!!, false)
        val textView = rootView.findViewById<TextView>(R.id.navigation_flow_item_tv)
        textView.text = dataList[position].name

        return rootView

    }

}